/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package aybolit.core.objects.dao.impl;

import aybolit.core.objects.dao.HospitalsDao;
import aybolit.core.objects.model.Hospitales;
import java.io.Serializable;
import java.util.List;
import javax.annotation.Resource;
import org.hibernate.SessionFactory;
import org.springframework.transaction.annotation.Transactional;

/**
 *
 * @author Masumov Emin
 */
@Transactional
public class HospitalsDaoImpl extends DAO implements Serializable, HospitalsDao{
SessionFactory sessionFactory;
    @Override
    public List<Hospitales> findAllHospitales() {
       return sessionFactory.getCurrentSession().getNamedQuery("Hospitales.findAllHospitalesByHosId").setParameter("hosid", getOperator().getHospitalId()).list();     
    }
    @Resource(name = "sessionFactory")
    public void setSessionFactory(SessionFactory sessionFactory) {
        this.sessionFactory = sessionFactory;
    }
    

}
